package com.LeeCode;

/**
 * 找到一个数字的 K 美丽值
 */

public class Code2269 {
    public static void main(String[] args) {
        System.out.println(new Code2269().divisorSubstrings(430043, 2));
    }

    public int divisorSubstrings(int num, int k) {
        int ans = 0;
        String s = String.valueOf(num);
        int len = s.length();
        for (int i = k; i <= len; i++) {
            int tmp = Integer.valueOf(s.substring(i - k, i));
            if (tmp != 0 && num % tmp == 0) {
                ans++;
            }
        }
        return ans;
    }
}
